package com.reportingapplication.teacher.tools;

import com.reportingapplication.teacher.MainActivity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class MessageReceiver extends BroadcastReceiver{
	
	@Override
	public void onReceive(Context context, Intent intent) {
		Intent i = new Intent(context, MainActivity.class);
		i.putExtras(intent.getExtras());
		i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		if(MainActivity.activity != null){
			MainActivity.activity.doThis(i);
		}else{
			context.startActivity(i);
		}
	}
}
